<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Ball Balancing Plate: Serial</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  <td id="projectlogo"><img alt="Logo" src="logo.jpg"/></td>
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Ball Balancing Plate
   &#160;<span id="projectnumber">1.0.0</span>
   </div>
   <div id="projectbrief">Object recognition and control algorithm software.</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('group___serial.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#define-members">Defines</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Serial</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_serial.html">Serial</a></td></tr>
<tr><td colspan="2"><h2><a name="define-members"></a>
Defines</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___serial.html#gae7676cdfa371dfdcf6fb0687737c29a6">WAIT_TIME</a>&#160;&#160;&#160;2000</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_serial.html">Serial</a> timeout.  <a href="#gae7676cdfa371dfdcf6fb0687737c29a6"></a><br/></td></tr>
<tr><td colspan="2"><h2><a name="func-members"></a>
Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___serial.html#ga53e1e7d545e9ca3776224344ea4c3719">Serial::Serial</a> (char *portName)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The Constructor.  <a href="#ga53e1e7d545e9ca3776224344ea4c3719"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___serial.html#ga5b32c394c0ff923a4ef1c13cfb20a6ba">Serial::~Serial</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">The destructor.  <a href="#ga5b32c394c0ff923a4ef1c13cfb20a6ba"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___serial.html#ga3874e3c10b006dc37584d45a928ae9db">Serial::ReadData</a> (char *buffer, unsigned int nbChar)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read data from serial port.  <a href="#ga3874e3c10b006dc37584d45a928ae9db"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___serial.html#ga3cce4a34142e8e2adbda131d43103e01">Serial::WriteData</a> (char *buffer, unsigned int nbChar)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Write data to serial port.  <a href="#ga3cce4a34142e8e2adbda131d43103e01"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group___serial.html#gaa53e46b5c8556152d5d3306fdab4117c">Serial::IsConnected</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the connection status.  <a href="#gaa53e46b5c8556152d5d3306fdab4117c"></a><br/></td></tr>
</table>
<hr/><h2>Define Documentation</h2>
<a class="anchor" id="gae7676cdfa371dfdcf6fb0687737c29a6"></a><!-- doxytag: member="serial.hpp::WAIT_TIME" ref="gae7676cdfa371dfdcf6fb0687737c29a6" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define <a class="el" href="group___serial.html#gae7676cdfa371dfdcf6fb0687737c29a6">WAIT_TIME</a>&#160;&#160;&#160;2000</td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p><a class="el" href="class_serial.html">Serial</a> timeout. </p>

</div>
</div>
<hr/><h2>Function Documentation</h2>
<a class="anchor" id="gaa53e46b5c8556152d5d3306fdab4117c"></a><!-- doxytag: member="Serial::IsConnected" ref="gaa53e46b5c8556152d5d3306fdab4117c" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="group___serial.html#gaa53e46b5c8556152d5d3306fdab4117c">Serial::IsConnected</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Get the connection status. </p>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE if serial port has been connected, FALSE otherwise. </dd></dl>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___serial_gaa53e46b5c8556152d5d3306fdab4117c_icgraph.png" border="0" usemap="#group___serial_gaa53e46b5c8556152d5d3306fdab4117c_icgraph" alt=""/></div>
<map name="group___serial_gaa53e46b5c8556152d5d3306fdab4117c_icgraph" id="group___serial_gaa53e46b5c8556152d5d3306fdab4117c_icgraph">
<area shape="rect" id="node3" href="group___control.html#gae689eda9201b54d1ca06a04a693b0e73" title="Check serial connection." alt="" coords="189,5,344,35"/><area shape="rect" id="node7" href="group___control.html#ga654ce447d37ead187bf4294108f14dff" title="Main control function." alt="" coords="205,59,328,88"/><area shape="rect" id="node5" href="group___main.html#gae66f6b31b5ad750f1fe042a706a4e3d4" title="The program entry point." alt="" coords="392,32,443,61"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ga3874e3c10b006dc37584d45a928ae9db"></a><!-- doxytag: member="Serial::ReadData" ref="ga3874e3c10b006dc37584d45a928ae9db" args="(char *buffer, unsigned int nbChar)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="group___serial.html#ga3874e3c10b006dc37584d45a928ae9db">Serial::ReadData</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>nbChar</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read data from serial port. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">buffer</td><td>the destination buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">nbChar</td><td>the number of bytes to read.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the number of bytes read. </dd></dl>
<dl class="retval"><dt><b>Return values:</b></dt><dd>
  <table class="retval">
    <tr><td class="paramname">-1</td><td>if nothing to read. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga53e1e7d545e9ca3776224344ea4c3719"></a><!-- doxytag: member="Serial::Serial" ref="ga53e1e7d545e9ca3776224344ea4c3719" args="(char *portName)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___serial.html#ga53e1e7d545e9ca3776224344ea4c3719">Serial::Serial</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>portName</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The Constructor. </p>
<p>Initialize <a class="el" href="class_serial.html">Serial</a> communication with the given COM port.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">portName</td><td>The serial port to initializa. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="ga3cce4a34142e8e2adbda131d43103e01"></a><!-- doxytag: member="Serial::WriteData" ref="ga3cce4a34142e8e2adbda131d43103e01" args="(char *buffer, unsigned int nbChar)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool <a class="el" href="group___serial.html#ga3cce4a34142e8e2adbda131d43103e01">Serial::WriteData</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>buffer</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">unsigned int&#160;</td>
          <td class="paramname"><em>nbChar</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write data to serial port. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">buffer</td><td>the source buffer. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">nbChar</td><td>the number of bytes to write.</td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>TRUE if write operation succeeded, FALSE otherwise. </dd></dl>

<p><div class="dynheader">
Here is the caller graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="group___serial_ga3cce4a34142e8e2adbda131d43103e01_icgraph.png" border="0" usemap="#group___serial_ga3cce4a34142e8e2adbda131d43103e01_icgraph" alt=""/></div>
<map name="group___serial_ga3cce4a34142e8e2adbda131d43103e01_icgraph" id="group___serial_ga3cce4a34142e8e2adbda131d43103e01_icgraph">
<area shape="rect" id="node3" href="group___control.html#ga654ce447d37ead187bf4294108f14dff" title="Main control function." alt="" coords="176,5,299,35"/><area shape="rect" id="node5" href="group___main.html#gae66f6b31b5ad750f1fe042a706a4e3d4" title="The program entry point." alt="" coords="347,5,397,35"/></map>
</div>
</p>

</div>
</div>
<a class="anchor" id="ga5b32c394c0ff923a4ef1c13cfb20a6ba"></a><!-- doxytag: member="Serial::~Serial" ref="ga5b32c394c0ff923a4ef1c13cfb20a6ba" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group___serial.html#ga5b32c394c0ff923a4ef1c13cfb20a6ba">Serial::~Serial</a> </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>The destructor. </p>
<p>Close the serial connection. </p>

</div>
</div>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div>
  <div id="nav-path" class="navpath">
    <ul>

    <li class="footer">Generated on Wed Jun 5 2013 12:20:17 for Ball Balancing Plate by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
